<?php
/**
 *
 * @author Jean-Baptiste
 * @version 
 */
/**
 * Career Form
 *
 * @uses ZendForm Zend_Form
 */
class Admin_Form_Partner extends Zend_Form 
{
    
	public function init() 
	{
	    // Config
	    $this->setName('partnerform')->setAction('/editpartner/process')->setMethod('POST');
		
	    //Validators
	    $length_validate = new Zend_Validate_StringLength(6, 50);

	    /********************************************************************************
	     NAME
	    *********************************************************************************/
	     
	    $name = new Zend_Form_Element_Text('name');
		$name->setLabel('Name')
		//->addFilters(array('StringTrim', 'HtmlEntities'))
		->setAttrib('minlength', '6')
		->setAttrib('class', 'field-text large required')
		->setDecorators(array(	'ViewHelper', 'Description', 'Errors',	array(array('data' => 'HtmlTag'), array('tag' => 'span')),
				array('Label', array('tag' => 'span')),
				array(array('row' => 'HtmlTag'), array('tag' => 'p', 'class' => 'clear'))
		))
		->addValidator($length_validate);
	     
	    
	    /********************************************************************************
	     DESCRIPTIONS
	    *********************************************************************************/
	     
	    require_once 'Descriptionform.php';
	    
	    /********************************************************************************
	     WEBSITES
	    *********************************************************************************/
	    
	   	$website = new Zend_Form_Element_Text('website');
		$website->setLabel('Website')
		//->addFilters(array('StringTrim', 'HtmlEntities'))
		->setAttrib('minlength', '6')
		->setAttrib('class', 'field-text large required')
		->setDecorators(array(	'ViewHelper', 'Description', 'Errors',	array(array('data' => 'HtmlTag'), array('tag' => 'span')),
				array('Label', array('tag' => 'span')),
				array(array('row' => 'HtmlTag'), array('tag' => 'p', 'class' => 'clear'))
		))
		->addValidator($length_validate);
		
		/********************************************************************************
		 IMAGE
		*********************************************************************************/
		
		require_once 'Imageform.php';
	    
	    /********************************************************************************
	     ALIAS
	    *********************************************************************************/
	     
	    // ALIAS
	    $alias = new Zend_Form_Element_Text('alias');
	    $alias->setLabel('Alias')
	    ->addFilters(array('StringTrim', 'HtmlEntities'))
	    ->setAttrib('class', 'field-text required')
	    ->setDecorators(array(	'ViewHelper', 'Description', 'Errors',	array(array('data' => 'HtmlTag'), array('tag' => 'span')),
	    		array('Label', array('tag' => 'span')),
	    		array(array('row' => 'HtmlTag'), array('tag' => 'p', 'class' => 'clear'))
	    ));
		$this->addElements(array(
				$name,
				$description_vi,
				$description_en,
				$description_ja,
				$description_zh,
				$description_fr,
				$website,
				$image,
				$alias
		));
		
		//$this->addDisplayGroup(array($title_vi, $title_en), 'display');
		
		$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'section')), 'Form'));
		return $this;
	}
}

